package com.common.atom.seal;

import com.common.atom.seal.param.*;
import com.common.atom.seal.util.CreateSealUtil;
import com.common.atom.seal.util.ImageUtils;
import com.common.atom.seal.util.SquareSealUtil;
import com.common.atom.seal.util.TriangleUtil;
/**
 * description: BitMapSealSdk <br>
 * date: 2023/4/13  <br>
 * author: zss <br>
 * version: 1.0.0 <br>
 */
public class BitMapSealSdk implements SealSdk{
    @Override
    public byte[] createSingleRowSeal(SingleRowSealParam sealParam) throws Exception {
        return ImageUtils.makeSingleRowSeal(sealParam);
    }

    @Override
    public byte[] createDoubleRowSeal(DoubleRowSealParam sealParam) throws Exception {
        return ImageUtils.makeDoubleRowSeal(sealParam);
    }


    /**
     * 创建方章
     *
     * @param squareSeal 方章参数
     * @return 返回结果
     * @throws Exception 创建异常
     */
    @Override
    public byte[] createSquareSeal(SquareSealParam squareSeal) throws Exception {
        return SquareSealUtil.drawSquareSeal(squareSeal);
    }

    @Override
    public byte[] createCircularSeal(CircularSealParam circularSeal) throws Exception {
        return CreateSealUtil.makeCircularStamp(circularSeal);
    }
    /**
     * 创建椭圆章
     *
     * @param ellipticSealDTO 椭圆章参数
     * @return 返回结果
     * @throws Exception 创建异常
     */
    @Override
    public byte[] createEllipticSeal(EllipticSealParam ellipticSealDTO) throws Exception {
        return CreateSealUtil.createEllipticSeal(ellipticSealDTO);
    }
    /**
     * 创建三角章
     *
     * @param triangleSealDTO 三角章参数
     * @return 返回结果
     * @throws Exception 创建异常
     */
    @Override
    public byte[] createTriangleSeal(TriangleSealParam triangleSealDTO) throws Exception {
        return TriangleUtil.drawTriangleSeal(triangleSealDTO);
    }

}
